package com.flycent.fanbao.ui;

import java.util.ArrayList;
import java.util.List;

import net.tsz.afinal.FinalActivity;
import net.tsz.afinal.annotation.view.ViewInject;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;

import com.flycent.fanbao.App;
import com.flycent.fanbao.R;
import com.flycent.fanbao.adapter.AbsViewHolderAdapter;
import com.flycent.fanbao.ui.view.HeaderGridView;

public class HearderGridActivity extends BackableTitleBarActivity{
	@ViewInject(id = R.id.mygrid) HeaderGridView mHeardGridView;
	
	private GridAdapter mAdapter;
	private View convertView;
 
	@Override
	protected void onCreate(Bundle savedInstance) {
		super.onCreate(savedInstance);
		setContentView(R.layout.activity_hearder_grid);
		FinalActivity.initInjectedView(this);
		getTitleBar().setTitle("HearderGridActivity");
		List<String> lists = new ArrayList<String>();
		for (int i = 0; i < 19; i++) {
			lists.add("i"+i);
		}
		
		convertView =  (View) LayoutInflater.from(HearderGridActivity.this).inflate(R.layout.activity_text, null);

		mHeardGridView.addHeaderView(convertView);//,null,false
		
		mAdapter = new GridAdapter(this, R.layout.item_grid_image);
		mHeardGridView.setAdapter(mAdapter);
		mAdapter.update(lists);
		
		mHeardGridView.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> parent,
					View view, int position, long id) {
				
			App.showShortToast(mAdapter.getData().get(position-2).toString());
				
			}
		});
		
	}
	
	
	
	
	
	public class GridAdapter extends AbsViewHolderAdapter<String>{

		public GridAdapter(Context context, int layoutRes) {
			super(context, layoutRes);
		}

		@Override
		protected void bindData(int pos, String itemData) {
			
		}
		
	}
	

}
